<div class="layui-form" style="padding: 20px 0 0 0;">
  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || 0 }}">
    </script>
  <div class="layui-form-item">
    <label class="layui-form-label">上级导航</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/setting/nav" lay-done="layui.form.render();">
        <select name="parent_id">
          <option value="0" {{# if(d.params.parent_id == 0){ }}selected{{# } }}>顶级导航</option>
          {{#  layui.each(d.data, function(index, item){ }}
          {{# if(d.params.id != item.id && item.parent_id == 0){ }}
          <option value="{{ item.id }}" {{# if(d.params.parent_id == item.id){ }}selected{{# } }}>{{ item.title }}</option>
          {{# } }}
          {{# }) }}
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">显示名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="title" value="{{ d.params.title || '' }}"  lay-verify="required" placeholder="请输入...(必填)" autocomplete="off" class="layui-input">
    </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">子标题</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="sub_title" value="{{ d.params.sub_title || '' }}" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">导航描述</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <textarea class="layui-textarea" name="description" rows="3">{{ d.params.description || '' }}</textarea>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="radio" name="nav_type" value="0" lay-filter="nav-type" title="内置" {{# if(d.params.nav_type == 0){ }}checked{{# } }}>
      <input type="radio" name="nav_type" value="1" lay-filter="nav-type" title="分类/页面" {{# if(d.params.nav_type == 1){ }}checked{{# } }}>
      <input type="radio" name="nav_type" value="2" lay-filter="nav-type" title="外链" {{# if(d.params.nav_type == 2){ }}checked{{# } }}>
      </script>
    </div>
  </div>
  <div class="layui-form-item nav-type-item" data-id="0">
    <label class="layui-form-label">内置导航</label>
    <div class="layui-input-inline">
      <select name="page_id">
        <option value="0" selected>首页</option>
        <option value="1" selected>文章首页</option>
        <option value="2" selected>产品首页</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item nav-type-item" data-id="1">
    <label class="layui-form-label">选择分类/页面</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/category/list" lay-done="layui.form.render();">
        <select name="page_id">
          <option value="">请选择分类/页面</option>
          {{#  layui.each(d.data, function(index, item){ }}
          <option value="{{ item.id }}" {{# if(d.params.page_id == item.id){ }}selected{{# } }}>{{ item.spacer }}{{ item.title }}</option>
          {{# }) }}
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item nav-type-item" data-id="2">
    <label class="layui-form-label">填写连接</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="text" name="link" value="{{ d.params.link || '' }}" autocomplete="off" class="layui-input">
      </script>
    </div>
    <div class="layui-form-mid layui-word-aux">连接使用http或https开头</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">排序</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
      <input type="number" name="sort" value="{{ d.params.sort || '' }}" autocomplete="off" class="layui-input">
      </script>
    </div>
    <div class="layui-form-mid layui-word-aux">值越小，排序越靠前，默认99</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="nav-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>